﻿@model qltscd.Models.ScreenClient.DMNKPScreenClient

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/Modules/_LayoutDanhMucNhapLieu.cshtml";
}

<h2>Danh Mục Nguồn Kinh Phí</h2>
@{
    Html.Telerik().Grid(Model.DSNguonKinhPhi)
    .Name("grdDSNKP")
    .DataKeys(keys => keys.Add(c => c.MaNguonKinhPhi))
    .Resizable(r => r.Columns(true))
    .Reorderable(r => r.Columns(true))
    .Sortable()
    .Pageable(paging => paging.Enabled(true).Style(GridPagerStyles.NextPreviousAndInput).PageSize(15))
    .Editable(editing => editing.Mode(GridEditMode.InCell))
    .ToolBar(t => {
        t.Insert().ButtonType(GridButtonType.ImageAndText).Text("Thêm nguốn kinh phí");
        t.SubmitChanges().ButtonType(GridButtonType.ImageAndText).SaveText("Lưu").CancelText("Hủy bỏ");
        t.Custom()
            .Text("In")
            .ButtonType(GridButtonType.ImageAndText)
            .Action("In", "DanhMucNguonKinhPhi")
            .ImageHtmlAttributes(new {
                @style = "background-image: url('./../../../../QuanLyThietBi/Content/Images/printer.png');"
            });
    })
    .DataBinding(databinding => {
        databinding.Server()
            .Select("Index", "DanhMucNguonKinhPhi");
        databinding.Ajax()
            .Select("_Index", "DanhMucNguonKinhPhi")
            .Insert("_Insert", "DanhMucNguonKinhPhi")
            .Delete("_Delete", "DanhMucNguonKinhPhi")
            .Update("_Update", "DanhMucNguonKinhPhi");
    })
    .Columns(column => {
        column.Template(
                @<text>
                    <input name="checkedRecords" type="checkbox" title="checkedRecords"
                    />
                </text>)
            .ClientTemplate("<input type='checkbox' name='checkedRecords'/>")
            .Title("").Width(50);
        column.Bound(o => o.MaNguonKinhPhi).Title("Mã Nguồn Kinh Phí");
      
        column.Bound(o => o.TenNguonKinhPhi).Title("Tên Nguồn Kinh Phí");
    
        
    })
    .Render();
    }


